from django.conf.urls.defaults import *
from monkeystudio.blogs.models import Post, Comment

# template_name setzen damit auch in templatedirs (settings.py) nach dem template gesucht wird !
postlist_dict = {
  'queryset'   : Post.objects.all(),
  'template_name' : 'post_list.html',
  'template_object_name' : 'post',
}

postdetail_dict = {
  'queryset'   : Post.objects.all(),
  'template_name' : 'post_details.html',
  'template_object_name' : 'post',
}

urlpatterns = patterns('',

    (r'^$', 'django.views.generic.list_detail.object_list', postlist_dict),
#    (r'^$', 'monkeystudio.blogs.views.list'),

#	(r'^$', 'django.views.generic.list_detail.object_list', simple_news_dict),
#	(r'^$', 'django.views.generic.date_based.archive_index', date_news_dict),
	(r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', postdetail_dict ),
	(r'^(?P<post_id>\d+)/comment/$', 'monkeystudio.blogs.views.comment' ),
	(r'^(?P<post_id>\d+)/akismeterror/$', 'monkeystudio.blogs.views.akismeterror' ),
    
    # (r'^archive/month/', 'django.views.generic.date_based.archive_year', info_dict2),
#    (r'^archive/', 'django.views.generic.date_based.archive_year', info_year),
    #(r'^(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', info_dict),
    #(r'^(?P<object_id>\d+)/results/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, template_name='polls/results.html')),
    #(r'^(?P<poll_id>\d+)/vote/$', 'mysite.polls.views.vote'),
)
